
#include "command/Create.h"
#include "command/Drop.h"
#include "command/Use.h"


//123
int main() {

    while(true)
    {
    
    std::cout << "mytestsql>";
    std::string in = " ",input = " ";
    getline(std::cin,input);
    while(input[input.size()-1] != ';')
    {
        std::cout << "         >";
        getline(std::cin,in);
        input += ' ';
        input += in;
    }
    input[input.size()-1] = ' ';

    std::vector<std::string> cmd = StringSplit(input, ' ');

    if(cmd.size() < 2){
        std::cout << "No such command" <<std::endl;
        continue;
    }
    cmdToUper(cmd[0]);
    if(cmd[0] == "CREATE") Create(cmd).execute();
    else if(cmd[0] == "DROP") Drop(cmd).execute();
    else if(cmd[0] == "USE") Use(cmd).execute();
    else if(cmd[0] == "QUIT") break;
    else std::cout << "No such command" <<std::endl;
    }
}